//
//  SWStagesFetchReq.swift
//  ChildStory
//
//  Created by linhan on 2016/11/11.
//  Copyright © 2016年 Aiya. All rights reserved.
//

import Foundation
class SWStagesFetchReq: SWBaseRequest
{
    override init()
    {
        super.init()
        api = SWRequestAPI.StagesFetch
    }
    
    override func JSONToModel(_ json:JSON, JSONString:String, JSONData:Data) -> AnyObject?
    {
        return Mapper<SWStagesFetchRsp>().map(JSONString: JSONString)
    }
}

class SWStagesFetchRsp: NSObject,Mappable
{
    var code:Int?
    var stages:[SWStageRsp]?
    var currentStageID:Int?
    
    required init?(map: Map) { }
    
    // Mappable
    func mapping(map: Map) {
        code        <- map["code"]
        stages      <- map["BaseModle.timeslist"]
        currentStageID      <- map["BaseModle.timeId"]
        
    }
}

class SWStageRsp: NSObject,Mappable
{
    var id:String?
    var title:String?
    var start:String?
    var end:String?
    
    required init?(map: Map) { }
    
    // Mappable
    func mapping(map: Map) {
        id              <- map["id"]
        title           <- map["title"]
        start           <- map["start"]
        end             <- map["end"]
    }
}
